package com.kedacom.general.netty;


import com.kedacom.general.netty.handler.UdpProcessHanlder;
import io.netty.channel.ChannelInitializer;
import io.netty.channel.ChannelPipeline;
import io.netty.channel.socket.nio.NioDatagramChannel;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @author 
 * @version 1.0.0
 */
@Component
@Slf4j
public class UdpServerlInitalizer extends ChannelInitializer<NioDatagramChannel> {

	@Autowired
	private UdpProcessHanlder processHandler;
	@Override
	protected void initChannel(NioDatagramChannel channel) throws Exception {
		log.info("initChannel!");
		ChannelPipeline pipeline = channel.pipeline();
		pipeline.addLast(processHandler);
	}
}


